package com.inspur.edp.common.expr.visitor.construct;

import com.inspur.edp.common.expr.spi.ConstructVisitor;
import com.inspur.edp.common.expr.visitor.VisitResult;
import com.inspur.edp.common.type.Type;
import com.inspur.edp.common.type.TypeRefer;


/**
 * @author lizhaorui
 * @description TODO
 * @date 2024/7/16 19:11
 */
public class JavaJsonArrayConstructVisitor implements ConstructVisitor {

    public static final String MODE = "json_array";

    @Override
    public String getType() {
        return MODE;
    }

    @Override
    public VisitResult visit(TypeRefer typeRefer, Type type, String parameters) {
        VisitResult visitResult=new VisitResult( "new ObjectMapper().createArrayNode()");
        visitResult.addImport("com.fasterxml.jackson.databind.ObjectMapper");
        return visitResult;
    }
}
